package com.example.yuejian21.nongfusanquan.yuejian21.model;

import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Postbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.UserCollectclubbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Userpostbean;
import com.example.yuejian21.nongfusanquan.yuejian21.service.PostService;
import com.example.yuejian21.nongfusanquan.yuejian21.service.UserService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Nongfusanquan on 2017-11-02.
 */

public class Postmodel {
    private Retrofit retrofit;
    public Postmodel(){
        retrofit = new Retrofit.Builder()
                .baseUrl("http://10.0.2.2/yuejian14/index.php/API/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<List<Postbean>>getPostlist(){
        PostService postService = retrofit.create(PostService.class);
        return postService.getPostlist();
    }


    public Call<List<Userpostbean>> getMypost(int user_id){
        UserService collectionService=retrofit.create(UserService.class);
        return collectionService.getMypost(user_id);
    }

}
